#pragma once

#include "ColligereUtils.hpp"

namespace col {

/////////////////////////////////////////////////
// HtmlLog
/////////////////////////////////////////////////

class HtmlLog : public wxLog
{
public:
	HtmlLog ( wxSimpleHtmlListBox *pLogTarget );
	virtual void DoLog ( wxLogLevel level, const wxString &rMsg, time_t );
private:
	wxSimpleHtmlListBox *mpLogTarget;
};

/////////////////////////////////////////////////
// LogDialog
/////////////////////////////////////////////////

class LogDialog : public wxDialog
{    
public:
    LogDialog ( wxFrame *pParent );

	void ResetLog();
	void SaveLog ( const wxString &rFile = wxString() );
	wxSimpleHtmlListBox *GetLogCtrl() const { return mpLogCtrl; }
private:
	void ConnectEventHandlers();

	void OnButtonOk ( wxCommandEvent &rEvent );
	void OnButtonSaveLogAs ( wxCommandEvent &rEvent );
	void OnButtonClearLog ( wxCommandEvent &rEvent );
	void OnClose ( wxCloseEvent &rEvent );

	wxSimpleHtmlListBox *mpLogCtrl;
};

}